import { BasicColumn } from "/@/components/Table";
import { GroupTypeEnum } from "/@/enums/typeEnum";
import { DescItem } from "/@/components/Description";

export const descSchema: DescItem[] = [
  {
    field: "groupName",
    label: "小组名称",
    contentMinWidth: 300,
  },
  {
    field: "type",
    label: "小组类型",
    render: (value) => {
      switch (value) {
        case GroupTypeEnum.DEFAULT:
          return "普通小组";
        case GroupTypeEnum.PRACTICAL:
          return "实习小组";
        default:
          return "非法类型";
      }
    },
  },
  {
    field: "total",
    label: "小组人数",
  },
  {
    field: "introduction",
    label: "小组介绍",
  },
  {
    field: "applyTime",
    label: "申请时间",
  },
  {
    field: "reason",
    label: "申请理由",
  },
];

export const basicColumns: BasicColumn[] = [
  {
    dataIndex: "groupId",
    title: "小组主键",
    ifShow: false,
  },
  {
    dataIndex: "groupName",
    title: "小组名称",
  },
  {
    dataIndex: "type",
    title: "小组类型",
    customRender: ({ text }) => {
      switch (text) {
        case GroupTypeEnum.DEFAULT:
          return "普通小组";
        case GroupTypeEnum.PRACTICAL:
          return "实习小组";
        default:
          return "非法类型";
      }
    },
  },
  {
    dataIndex: "applyTime",
    title: "申请时间",
  },
];
